<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <?php ob_start(); ?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="../css/stylesite.css" medial="all" />
<link rel="stylesheet" type="text/css" href="../css/styleleft.css" medial="all" />
<link rel="stylesheet" type="text/css" href="../css/mystyle.css" />
<script type="text/javascript" src="../js/jquery-1.8.2.min.js"></script>
<style>
    a{color: blue;}
    a:hover{color: #f80c0c;}
</style>
	<script src="../js/jquery-1.8.2.min.js" ></script>
	<script src="../js/image.js" type="text/javascript"></script>
         <script src="../js/jsearch.js" type="text/javascript"></script>  
<title>QUẢN LÝ DANH MỤC</title>

</head>

<body class="pagebody">
	<div id="wrapwebsite" >

                     <?php
                        include 'category_model.php';
                        if(isset($_GET['ID_category']))
                        {
                            $id=$_GET['ID_category'];
                            $conn=  getConnect();             
                        $sql="select * from categories where CategoryID='$id' ";
                        $result=  mysql_query($sql, $conn);
                        if(!$result)
                            die('Truy van ko hop le');
                        $loaisp=NULL;
                        while($row= mysql_fetch_assoc($result))
                        {
                           
                            if($row['ParentID']==1)
                                $loaisp="Bánh";
                            else
                                $loaisp="Hoa";
                            if($row['isVisable']==1)
                                $vi="Yes";
                            else
                                $vi="No";
                          
                        
                    ?>
                      <div class="idThem">
              <form action="c_categoryAdd.php" method="get">
  		<table width="400" >
                   <tr>
                    <td width="150px">Category ID</td>
                    <td width="250px"><input style="font-size:18px; padding:5px; width:220px;margin-bottom: 5px " name="txtCateID" type="text" size="30px" value="<?php echo $row['CategoryID'];?>" readonly="readonly"/></td>
                  </tr>
                    <tr>
                    <td width="150px">Category Name</td>
                    <td width="250px"><input style="font-size:18px; padding:5px; width:220px;margin-bottom: 5px " name="txtCateName" type="text" size="30px" value="<?php echo $row['CategoryName'];?>"/></td>
                  </tr>
                  <tr>
                    <td>Category</td>
                    <td>&nbsp; 
                    <select name="txtCate" value="$aa">
                        <?php if($loaisp=="Bánh"){ ?>
                        <option value="1"><?php echo $loaisp; ?></option>
                        <option value="2">Hoa</option>
                        <?php } else {?>
                         <option value="2"><?php echo $loaisp; ?></option>
                        <option value="1">Bánh</option>
                        <?php }?>
                    </select>
                    </td>
                  </tr>
                  <tr>
                    <td>Visible</td>
                    <td>&nbsp; <select name="txtVisible">
                          <?php if($vi=="Yes"){ ?>
                        <option value="1"><?php echo $vi; ?></option>
                        <option value="0">No</option>
                        <?php } else {?>
                         <option value="0"><?php echo $vi; ?></option>
                        <option value="1">Yes</option>
                        <?php }?>
                    </select>
                    </td>
                  </tr>
                  <tr>
                   <?php }}?>
                    <td align="center" colspan="2">&nbsp;  <input name="submit" type="submit" value="Update" class="button" /><input name="reset" type="reset" value="Reset" class="button" /></td>
                  </tr>
                </table>   
                </form>
                </div>
                   
            </div>        
</body>
</html>
